Skip to content

fix: defects found by review of #426–#432 - #433

Open
codecaaron wants to merge 3 commits into
mainfrom
fix/review-findings
Open

codecaaron wants to merge 3 commits into
mainfrom
fix/review-findings

Conversation

@codecaaron

Copy link
Copy Markdown
Owner

Fixes for defects found by an independent review of everything merged in #426 to #432. Three reviewers read the diff cold, one area each; most findings came with a reproduction. Every fix here has a test that was written first and seen to fail for the stated reason.

Extractor

  • staticCss stopped protecting a variant with no defaultVariant. feat!: faster style-object types; sound pruning of unused options #429 began tracking such variants, but forced usage was only injected when a default existed. A component forced with "variants": "*" kept no options. Forced usage is now always injected; it can only add options to the kept set.
  • View-transition pruning dropped CSS that was still referenced. feat!: structured diagnostics, tighter types, CI hardening #427 counted a use only when a named import resolved to an analysed file, so a namespace import, a dynamic import, or a system imported from a package lost every transition. A collection is now kept whole whenever its use cannot be bounded: an incomplete analysis (the same signal that turns component pruning off), a collection declared outside the analysed files, a re-export or alias, a namespace, or a runtime module load.
  • An unsupported at-rule was reported at its block's opening brace, with the whole block as value. It is reported at the at-rule's key.
  • Smaller: the unsupported-feature value field has one form; a failing theme-values script no longer fails the system load; opacity modifiers in the theme values follow the Rust rules.

Core, React, Effect UI

  • fromDTCG on a JSON import lost its scales. A $type widened to string matched the typography test, so every group became a declaration scale and the theme type had no colors key. Such a document now keeps every scale with its real keys.
  • Boolean variant conditions in contracts. when: { flag: true } threw on every render in React and never matched in Effect UI; in the types it made the obligation unconditional. true and 'true' are now equivalent and match a boolean or string prop, in both bindings.
  • Resolver documents. Group $type resolves across sources, sets and contexts, as DTCG Resolver §6.2 requires. A path that is a token in one layer and a group in another is rejected instead of silently dropping the token.
  • Export. A stored hex is reused only while its colour is unchanged; a token that became an alias takes its target's type; one-layer shadow lists and $root-only typography groups survive; out-of-range alpha and cubic-bezier values and upper-case units are refused with the token path.
  • addColorModes rejects a mode alias that references an earlier mode alias; the run time always did.

Pipeline, plugins, CLI

  • Source-map chaining keeps an incoming map's sourceRoot and ignore lists, and leaves code the incoming map does not cover unmapped instead of attributing it to position 0:0.
  • Maps where code moved. unplugin returns a map when it replaces __ANIMUS_DEV__ in a file the engine did not transform (Rollup treated the missing map as "nothing moved": a token mapped to column 36 when it was at 45); the Next loaders return one when they add or remove the stylesheet import. No map is returned when the code a host passes differs from the analysed source.
  • animus check and MCP check_source disagreed with the build in both directions: check missed a custom-property finding the build reported and reported an unresolved import the build did not. Both now run through the build's analysis path.
  • animus mcp advertises only the current protocol revision as supported, and accepts JSON-RPC batches for clients that negotiated 2025-03-26.

Left as they are

  • A contract on a member of a composed family, conditioned on a variant shared from the family's Root, is not required at the member: the member's type cannot see the Root's props.
  • For asComponent(...) and as={Component}, the types apply every whenTag rule's obligations, while the run time, which cannot know the tag, skips those rules' attributes.
  • After .extend(builtTheme), a mode alias referencing an inherited mode alias still type-checks and fails at run time.
  • The target-support check does not use targets a bundler host supplies; a framework plugin can set those without the user choosing them.

Verification

vp run verify:full passes at 10761aa9: 55 of 55 tasks, with 592 TypeScript tests, 413 Rust tests and 289 integration tests. @animus-ui/effect-ui-app#verify passes. The parity baselines are unchanged.

🤖 Generated with Claude Code

codecaaron and others added 3 commits November 28, 2026 05:50
staticCss stopped protecting a variant with no defaultVariant once such variants were tracked: forced usage was only injected when a default existed. It is now always injected.

A registered view transition was dropped in production unless a named import resolved to an analysed file, so a namespace import, a dynamic import or a system imported from a package lost its CSS. A collection is now kept whole whenever its use cannot be bounded, reusing the signal that already turns component pruning off.

An unsupported at-rule was reported at its block's opening brace with the block's source as the value; it is reported at the at-rule's key. The unsupported-feature value field has one form, a failing theme-values script no longer fails the system load, and opacity modifiers in the theme values follow the Rust rules.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ects

fromDTCG: a document typed as a JSON import no longer loses its scales to typography inference; group $type resolves across the sources, sets and contexts of a resolver document; a path that is a token in one layer and a group in another is rejected instead of dropping the token. toDTCG: a stored hex is reused only while its colour is unchanged; an aliased token takes its target's type; one-layer shadow lists and $root-only typography groups survive; out-of-range alpha and cubic-bezier values and upper-case units are refused with the token path.

Contracts: a boolean variant condition and its string form are equivalent and match a boolean or string prop, in the types and at run time in both bindings; before, React threw and Effect UI never matched. addColorModes rejects a mode alias that references an earlier mode alias, as the run time always did.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…d, MCP versions

A map composed with an incoming map keeps its sourceRoot and ignore lists and leaves code the incoming map does not cover unmapped. Hosts get a map when a define substitution or a stylesheet import moves code in a file the engine did not transform, and no map when the code they pass differs from the analysed source.

animus check and the MCP check_source tool run through the same analysis path as the build, so they report the build's custom-property, system and kit diagnostics and use the same resolution evidence. The MCP server advertises only the current protocol revision as supported and accepts batches for clients that negotiated 2025-03-26.

Verified at this commit: vp run verify:full (55 of 55 tasks) and the effect-ui app's verify.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant